//============================================================================
// Name        : testqlite.cpp
// Author      : alex
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sqlite3.h>
using namespace std;

int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	sqlite3 *database;
	sqlite3_open("Database.sqlite", &database);
	sqlite3_stmt *statement;


	if(sqlite3_prepare_v2(database, "CREATE TABLE a (b INTEGER, c INTEGER);", -1, &statement, 0) == SQLITE_OK)

	    {

	        int cols = sqlite3_column_count(statement);

	        int result = 0;

	        while(true)

	        {

	            result = sqlite3_step(statement);
	            if(result == SQLITE_ROW)
	            {
	                for(int col = 0; col < cols; col++)
	                {
	                    string s = (char*)sqlite3_column_text(statement, col);
	                    //do something with it
	                }
	            }
	            else
	            {
	                break;
	            }
	        }
	        sqlite3_finalize(statement);

	    }

	return 0;
}
